package com.swm.model;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.KeyFactory;

@XmlAccessorType(XmlAccessType.FIELD)
//@XmlType(name = "", propOrder = { "id", "password" })
@XmlRootElement(name = "Testcase")
@PersistenceCapable
public class Testcase {
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;
	
	@Persistent
	private String testcaseName;
	
	@Persistent
	private String projectName;
	
	@Persistent
	private String contents;
	
	public Testcase(){
		
	}
	public String getTestcaseName() {
		return testcaseName;
	}

	public String getProjectName() {
		return projectName;
	}

	public void setTestcaseName(String testcaseName) {
		this.testcaseName = testcaseName;
	}

	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}

	public String getContents() {
		return contents;
	}

	public void setContents(String contents) {
		this.contents = contents;
	}
	
	public static Key generateKey(String name) {
		return KeyFactory.createKey(Testcase.class.getSimpleName(), name);
	}
	
	public Key getKey() {
		return key;
	}

	public void setKey(Key key) {
		this.key = key;
	}

}
